package file;

import java.io.File;

public class ListFileDemo2 {
    public static void main(String[] args) {
        File dir = new File(".");
        if (dir.isDirectory()) {
            File[] file = dir.listFiles(f -> f.getName().startsWith("."));
            for (File f : file) {
                System.out.println(f.getName());
            }
        }else {
            System.out.println("不是目录");
        }
    }
}
